import request from '@/router/axios';

export const getList = (current, size, params,tableName) => {
  return request({
    url: '/api/vingsoft-acceptance/basicLink/list',
    method: 'get',
    params: {
      ...params,
      tableName,
      current,
      size,
    }
  })
}

export const add = (row) => {
  return request({
    url: '/api/vingsoft-acceptance/basicLink/save',
    method: 'post',
    data: row
  })
}

export const getSelectList = (itemId,tableName) => {
  return request({
    url: '/api/vingsoft-acceptance/basicLink/getList',
    method: 'get',
    params: {
      itemId,
      tableName
    }
  })
}

export const getMaterialList = (rowGuid,tableName,taskCodeLink,materialName) => {
  return request({
    url: '/api/vingsoft-acceptance/basicLink/getMaterialList',
    method: 'get',
    params: {
      rowGuid,
      tableName,
      taskCodeLink,
      materialName
    }
  })
}

export const materiallist = (current, size, params,tableName) => {
  return request({
    url: '/api/vingsoft-acceptance/basicLink/materiallist',
    method: 'get',
    params: {
      ...params,
      tableName,
      current,
      size,
    }
  })
}


export const cancelLink = (itemId) => {
  return request({
    url: '/api/vingsoft-acceptance/basicLink/cancelLink',
    method: 'post',
    params: {
      itemId
    }
  })
}
